/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.pa165.machineryrental.dto;

import java.util.Date;

/**
 *
 * @author Marian Lorenc, 374122
 */
public class RevisionDTO {

     /**
     * Unique id.
     */
    private long id;
    
    /*
     * Date of revision.
     */
    private Date dateOfRevision;
    
    /*
     * Description of revision.
     */
    private String description;
    
    /*
     * Revisioned machine.
     */
    private MachineDTO machine;

	/**
	 * Return machine of revision.
	 * @return Machine
	 */
	public MachineDTO getMachine() {
		return machine;
	}

	/**
	 * Sets machine, where was this revision
	 * @param machine Machine 
	 */
	public void setMachine(MachineDTO machine) {
		this.machine = machine;
	}

    /**
     * Returns identifier of revision
     * @return Identifier of revision
     */
    public long getId() {
        return id;
    }
    
    /**
     * Sets given id.
     * @param id Id of revision
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * Returns date of revision
     * @return date of revision
     */
    public Date getDateOfRevision() {
        return dateOfRevision;
    }

    /**
     * set date of the revision
     * @param dateOfRevision is date of the revision
     */
    public void setDateOfRevision(Date dateOfRevision) {
        this.dateOfRevision = dateOfRevision;
    }

    /**
     * Returns description of the revision
     * @return description of the revision
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets description of the revision
     * @param description is a text description of the revision
     */
    public void setDescription(String description) {
        this.description = description;
    }
    
   
    @Override
    public String toString() {
        return "RevisionDTO{" + "id=" + id + ", date=" + dateOfRevision + ", description=" + description  + '}';
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (int) (id ^ (id >>> 32));
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof RevisionDTO)) {
            return false;
        }
        RevisionDTO other = (RevisionDTO) obj;
        return id == other.id;
    } 
}
